package com.anran.passenger.controller;

import com.anran.common.response.ResponseResult;
import com.anran.passenger.service.VerificationCodeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 校验验证码
 */

@RestController
public class VerificationCodeController {

    @Resource
    private VerificationCodeService verificationCodeService;


    @GetMapping("/verification-code")
    public ResponseResult Test(@RequestParam String passengerPhone){
        try {
            verificationCodeService.generationCode(passengerPhone);
            return ResponseResult.success("成功");
        } catch (Exception e) {
            return ResponseResult.fail("获取验证码错误");
        }
    }
}
